#include<iostream>
#include<vector>
#include<cmath>
using namespace std;

void pardon(int x,int y,int n,auto &line){
  if(n==0) return;
  int half=pow(2,n-1);
  for(int m=x;m<x+half;m++){
    for(int n=y;n<y+half;n++){
      line[m][n]=0;
    }
  }
  pardon(x+half,y,n-1,line);
  pardon(x,y+half,n-1,line);
  pardon(x+half,y+half,n-1,line);
}

int main(){
  int n;
  cin>>n;
  auto line=vector(pow(2,n),vector(pow(2,n),1));
  pardon(0,0,n,line);
  for(auto x:line){
    for(auto y:x) cout<<y<<' ';
    cout<<endl;
  }
}